import request from '@/utils/request'
import { config } from '@/utils/requestconfig'
// 单位菜单
export function GetUnitMenus() {
  return request({
    baseURL: config.webapi,
    url: 'Modules/GetUnitMenus',
    method: 'get'
  })
}
export function GetPermissionGroup(params) {
  return request({
    baseURL: config.webapi,
    url: 'Permission/GetPermissionGroup',
    method: 'get',
    params
  })
}
export function GetPermissionGroupMenus(params) {
  return request({
    baseURL: config.webapi,
    url: 'Permission/GetPermissionGroupMenus',
    method: 'get',
    params
  })
}
export function GetPermissionGroupUser(params) {
  return request({
    baseURL: config.webapi,
    url: 'Permission/GetPermissionGroupUser',
    method: 'get',
    params
  })
}
export function AddPermissionGroup(data) {
  return request({
    baseURL: config.webapi,
    url: 'Permission/AddPermissionGroup',
    method: 'post',
    data
  })
}
export function EditPermissionGroup(data) {
  return request({
    baseURL: config.webapi,
    url: 'Permission/EditPermissionGroup',
    method: 'post',
    data
  })
}
export function DelPermissionGroup(id) {
  return request({
    baseURL: config.webapi,
    url: 'Permission/DelPermissionGroup',
    method: 'post',
    params: { id: id }
  })
}
// 编辑权限 权限组下的用户
export function EditPermission(data) {
  return request({
    baseURL: config.webapi,
    url: 'Permission/EditPermission',
    method: 'post',
    data
  })
}
export function GetPermissionPersonList(params) {
  return request({
    baseURL: config.webapi,
    url: 'Permission/GetPermissionPersonList',
    method: 'get',
    params
  })
}
export function GetPermissionPersonInfo(userId) {
  return request({
    baseURL: config.webapi,
    url: 'Permission/GetPermissionPersonInfo',
    method: 'get',
    params: { userId: userId }
  })
}
// 获取某一菜单被权限组引用情况
export function GetPermissionMenuInfo(moduleId) {
  return request({
    baseURL: config.webapi,
    url: 'Permission/GetPermissionMenuInfo',
    method: 'get',
    params: { moduleId: moduleId }
  })
}
// 给权限组分配人员
export function EditPermissionPersonSave(data) {
  return request({
    baseURL: config.webapi,
    url: 'Permission/EditPermissionPersonSave',
    method: 'post',
    data
  })
}

